package com.heima.model.user.pojos;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("ap_user_fan")
@ApiModel(value = "ApUserFan", description = "app用户粉丝信息表")
public class ApUserFan {
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(value = "作者id")
    @TableField("user_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    @ApiModelProperty(value = "粉丝 id")
    @TableField("fans_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long fansId;

    @ApiModelProperty(value = "粉丝名称")
    @TableField("fans_name")
    private String fansName;

    @ApiModelProperty(value = "粉丝忠诚度 0 正常, 1 潜力股, 2 勇士, 3 铁杆, 4 老铁")
    @TableField("level")
    private Short level;

    @ApiModelProperty(value = "记录创建时间")
    @TableField("created_time")
    private LocalDateTime createdTime;

    @ApiModelProperty(value = "是否可见我动态")
    @TableField("is_display")
    private Short displayed;

    @ApiModelProperty(value = "是否屏蔽私信")
    @TableField("is_shield_Letter")
    private Short shieldLettered;

    @ApiModelProperty(value = "是否屏蔽评论")
    @TableField("is_shield_Comment")
    private Short shieldCommented;

    public enum FansLevel {

        NORMAL((short) 0), POTENTIAL((short) 1), HIGH((short) 2), SUPER((short) 3), EXTREME((short) 4)
        ;

        private final Short levelValue;

        FansLevel(Short levelValue) {
            this.levelValue = levelValue;
        }

        public Short getLevelValue() {
            return levelValue;
        }
    }

}
